package sketch;

import java.awt.*;

/**
 * GraphModel contains the data for plotting a curve
 * 
 * @author Indrojeet Mondal
 * @version 1.0
 *
 */

class GraphModel 
{
	public String equation1, equation2;
	public int eqnType;
	
	public int xMin, xMax;
	public int curZoom;
	//public boolean showAxes, showGrid;
	public Color curveColor;
	public Color axesColor;//, gridColor;
	public Color backColor;
	
	/**
	 * Create a default settings to plot a curve
	 * @return the default settings
	 */
	public GraphModel()
	{
		
		eqnType = GraphModel.CARTESIAN;
		equation1 = "x^3";
		equation2 = null;
		xMin = -6;
		xMax = +6;
		curZoom = 1;
		/*
		settings.showAxes = true;
		settings.showGrid = true;*/
		curveColor = Color.BLUE;
		axesColor = Color.BLACK;
		//settings.gridColor = Color.LIGHT_GRAY;
		backColor = Color.WHITE;
	}
	public String getEqnString()
	{
		StringBuffer sb = new StringBuffer();
		
		switch (eqnType) {
		case CARTESIAN:
			sb.append("y = " + equation1);
			break;
		case POLAR:
			sb.append("r = " + equation1);
			break;
		case PARAMETRIC:
			sb.append("x(t) = " + equation1 + ", y(t) = " + equation2);
			break;
		}
		return sb.toString();
	}
	public static final String[] typeStr = { "Cartesian", "Polar", "Parametric" };
	
	// the equation types
	public static final int CARTESIAN = 0;
	public static final int POLAR = 1;
	public static final int PARAMETRIC = 2;

}
